<template>
	<view class="container">
		<view class="header">
			<!-- <nav-bar title="个人中心" :color="navBarColor" :bg="navBarBg" /> -->
			<!-- <u-swiper :list="list3" indicator indicatorMode="line" circular height="433rpx"
				indicatorStyle="bottom: 50rpx"></u-swiper> -->
			<u-swiper :list="list3" keyName="banner_image" height="433rpx"
				@click="onswiperclick"></u-swiper>
		</view>

		<div :class="[{ banner_disabled: homeData.banner_state == 0 }, 'peter']">
			<u-scroll-list v-if="homeData.vajra_state == 1" :indicator="homeData.cate > 10">
				<view class="peter-cates">
					<!-- 第一行 -->
					<view class="cates">
						<view class="cate-item" v-for="(item, index) in list_s" :key="index">
							<u--image :src=item.url width="80rpx" height="80rpx">
							</u--image>
							<text>{{item.name}}</text>
						</view>
					</view>

				</view>
			</u-scroll-list>
		</div>
		<!-- 通知公告 -->
		<!-- <view class="notice">
			<u-notice-bar :text="text1" bgColor="#fff" color="#333333" @click="openNotice" direction="column"
				icon="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/89283211901b92921a2c2ffb6adb5e5f81fa5416.png">
			</u-notice-bar>
		</view> -->
		<!-- 行业资讯 -->
		<view>
			<view class="business">
				<view class="business-line"></view>
				<view class="business-title" @click="addd">
					<text> 行业动态 </text>
				</view>
				<view class="news-list-more" @click="goNewsList">
					<text>更多</text>
					<u-icon name="arrow-right" :customStyle="{ color: 'rgb(190,190,190) !important' }" :bold="true">
					</u-icon>
				</view>
			</view>
			<view class="news-list">
				<view class="new-item" v-for="(item, index) in newsList" :key="index" @click="goNewsDetail(item.id)">
					<view class="new-item-left">
						<view class="new-item-title">
							<!-- <u-tag
		            text="头条"
		            plain
		            size="mini"
		            type="warning"
		            v-if="index == 0"
		          ></u-tag>
		          <u--text
		            :text="item.name"
		            lines="2"
		            color="rgb(51,51,51)"
		            size="30rpx"
		            :bold="true"
		          ></u--text> -->
							<view class="">
								<text
									style="width: 40rpx;height: 15rpx;background-color:  rgb(249,52,66); padding: 0rpx 14rpx ;color: rgb(255, 255, 255);font-size: 24rpx;"
									v-if="index == 0">头条</text>
								<text style="color: rgb(51,51,51);padding: 10rpx 4rpx 10rpx;font-size: 30rpx;text-decoration: none;
		font-weight: bold;
		word-wrap: normal;">{{item.name}}</text>

							</view>
						</view>
						<view>
							<u--text :text="item.remark" lines="2" color="rgb(190,190,190)" size="25rpx"></u--text>
						</view>
						<view class="new-item-time">
							<view class="building">
								<u--text :prefixIcon="building" :text="item.sender" align="left" size="20rpx"
									:iconStyle="{ width: 20 + 'rpx', height: 20 + 'rpx' }" color="#999999" lines="1">
								</u--text>
							</view>
							<text class="new-item-time-line">|</text>
							<u--text :text="item.create_at" size="20rpx" color="#999999" align="left"></u--text>
						</view>
					</view>
					<view class="new-item-right">
						<u--image :src="item.cover" width="220rpx" height="138rpx" :showMenuByLongpress="false">
						</u--image>
					</view>
				</view>
			</view>
		</view>

		<tabber :active="0"></tabber>
	</view>
</template>

<script>
	const index = require("@/api/index/index.js");
	import navbar from '@/mixins/navbar.js';
	export default {
		mixins: [navbar({
			navBarColor: '#000'
		})],
		data() {
			return {
				list3: [
					{
						applet_id: 21,
						banner_image: "https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/6b2bbb1a54c3fda142db46d00d591c73ddbb5308.png",
						image_type: 0,
					},
					{
						applet_id: 21,
						banner_image: "https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/6b2bbb1a54c3fda142db46d00d591c73ddbb5308.png",
						image_type: 0,
					},
					{
						applet_id: 21,
						banner_image: "https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/6b2bbb1a54c3fda142db46d00d591c73ddbb5308.png",
						image_type: 0,
					}
				],
				text1: [
					'寒雨连江夜入吴士大夫大师傅十分',
					'平明送客楚山孤自行车自行车',
					'洛阳亲友如相问阿瑟东撒的飒飒',
					'一片冰心在玉壶'
				],
				homeData: {
					banner_state: 1,
					vajra_state: 1,
					cate: 5
				},
				newsList: [],
				list_s: [{
						name: '证词文件',
						url: 'https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/7831edf944cc169deb1b14ff864fa1f05710d076.png'
					},
					{
						name: '展会信息',
						url: 'https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/159f727b61b73a74d09012ed00bd35524e5681d3.png',
					},
					{
						name: '行业动态',
						url: 'https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/d7b70d4a57e5e0f44c4c3d58269c745cb37526bc.png'
					},
					{
						name: '最新动态',
						url: 'https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/079e98f4a644e519ca8fce7caf56e0ab0008e39c.png'
					},
					{
						name: '智慧体育',
						url: 'https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/cfad792d253fa8fed6ac3469b3bc1c6bde58c8f6.png'
					},
				]

			}
		},
		onLoad() {
			this.getNewsList()
		},
		methods: {
			async getNewsList() {
				let that = this;
				let data = {};
				let result = await index.getNewsList(data);
				if (result.code == 1) {
					this.newsList = result.data.data
				}
			},
			goNewsDetail(id) {
				uni.navigateTo({
					url: "/page_venues/newsDetailPages/newsDetailPages?id=" + id,
				});
			},
			goNewsList() {
				uni.navigateTo({
					url: "/page_venues/newsListPages/newsListPages",
				});
			},
			addd() {
				uni.navigateTo({
					url: "./new_file",
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	@import url("@/static/css/index/index.css");

	.container {
		width: 100%;
		min-height: 100vh;
		padding-bottom: 180rpx;

		.header {
			// padding-left: 30rpx;
			// margin-top: 60rpx;

		}

		.notice /deep/ .u-icon__img {
			width: 60rpx !important;
			height: 30rpx !important;
		}



	}
</style>